// GroupWhiteboard
//
// This class represents the whiteboard space for one customer group.
// It will be protected by a monitor and will be used by a customer group
// to aggregate data and make decisions.
//

#include "GroupWhiteboard.h"
#include "system.h"

// Initialize the GroupWhiteboard object
GroupWhiteboard::GroupWhiteboard() {
	groupSize = 0;
	popcornTally = 0;
	sodaTally = 0;
	bathroomTally = 0;
	numModified = 0;
	ticketStub = NULL;
	someoneNeedsBathroom = false;
	state = 0;
}
// De-allocate bitmap		
GroupWhiteboard::~GroupWhiteboard() {
	delete ticketStub;
}	

// returns the size of the associated group
int GroupWhiteboard::getGroupSize() {
	return groupSize;
}	
// returns current number of popcorn to purchase	
int GroupWhiteboard::getPopcornTally() {
	return popcornTally;
}	
// returns current number of soda to purchase
int GroupWhiteboard::getSodaTally() {
	return sodaTally;
}
// returns current number of customers who need to use the bathroom
int GroupWhiteboard::getBathroomTally() {
	return bathroomTally;
}
// returns current number of customers who have modified the whiteboard
int GroupWhiteboard::getNumModified() {
	return numModified;
}
//returns the state to get food or bathroom
int GroupWhiteboard::getState(){
	return state;
}
// returns TicketStub currently held by group
TicketStub* GroupWhiteboard::getTicketStub() {
	return ticketStub;
}

bool GroupWhiteboard::getSomeoneNeedsBathroom(){
	return someoneNeedsBathroom;
}

// sets the size of the associated group
void GroupWhiteboard::setGroupSize(int gs) {
	this->groupSize = gs;
}
// sets the current number of popcorn to purchase			
void GroupWhiteboard::setPopcornTally(int pt) {
	this->popcornTally = pt;
}
// sets the current number of soda to purchase	
void GroupWhiteboard::setSodaTally(int st) {
	this->sodaTally = st;
}
// sets the current number of customers who need to use the bathroom
void GroupWhiteboard::setBathroomTally(int bt) {
	this->bathroomTally = bt;
}
// sets the current number of customers who modified the whiteboard
void GroupWhiteboard::setNumModified(int nm) {
	this->numModified = nm;
}
// sets the TicketStub currently held by group
void GroupWhiteboard::setTicketStub(TicketStub* s) {
	this->ticketStub = s;
}

void GroupWhiteboard::setState(int st){
	state = st;
}

// adds to the current number of popcorn to purchase
void GroupWhiteboard::incrementPopcornTally(int pt) {
	this->popcornTally += pt;
}
// adds to the current number of soda to purchase
void GroupWhiteboard::incrementSodaTally(int st) {
	this->sodaTally += st;
}
// adds to the current number of customers who need to use the bathroom
void GroupWhiteboard::incrementBathroomTally(int bt) {
	this->bathroomTally += bt;
}
// adds to the current number of customers who have modified the whiteboard
void GroupWhiteboard::incrementNumModified() {
	this->numModified += 1;
}

void GroupWhiteboard::setSomeoneNeedsBathroom(bool value){
	someoneNeedsBathroom = value;
}
